home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1951 / 1951.xpi / chrome / fission.jar / content / fission / fission.xml < prev    next >
Extensible Markup Language  |  2009-05-08  |  3KB  |  94 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
  4.     <!-- binding for Firefox 3.0 and later -->
  5.     <binding id="fission-urlbar-redux" extends="chrome://browser/content/urlbarBindings.xml#urlbar">
  6.         <content sizetopopup="pref" fission="">
  7.             <xul:hbox class="autocomplete-textbox-container" flex="1">
  8.                 <children includes="image|deck|stack|box">
  9.                     <xul:image class="autocomplete-icon" allowevents="true"/>
  10.                 </children>
  11.                 <xul:stack class="fission-progress-stack" flex="1">
  12.                     <children includes="progressmeter"/>
  13.                     <xul:hbox class="autocomplete-textbox-container-fission">
  14.                         <xul:hbox anonid="textbox-input-box" class="textbox-input-box" flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
  15.                             <children/>
  16.                             <html:input anonid="input" class="autocomplete-textbox textbox-input" flex="1" allowevents="true" xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,userAction"/>
  17.                         </xul:hbox>
  18.                         <children includes="hbox"/>
  19.                     </xul:hbox>
  20.                 </xul:stack>
  21.             </xul:hbox>
  22.             <xul:dropmarker anonid="historydropmarker" class="autocomplete-history-dropmarker" allowevents="true" xbl:inherits="open,enablehistory"/>
  23.             <xul:popupset anonid="popupset" class="autocomplete-result-popupset"/>
  24.         </content>
  25.     </binding>
  26.  
  27.     <binding id="smooth-progressbar" extends="chrome://global/content/bindings/progressmeter.xml#progressmeter">
  28.         <implementation>
  29.             <field name="_animation">null</field>
  30.             <field name="_precValue">parseFloat(this.value)</field>
  31.             <field name="_officialValue">Math.round(this.value)</field>
  32.  
  33.             <property name="precValue" onget="return this._precValue;" onset="this.setAttribute('value', Math.round((this._precValue = val))); return val;"/>
  34.  
  35.             <method name="endAnimation">
  36.                 <parameter name="aValue"/>
  37.                 <body><![CDATA[
  38.                     if (this._animation)
  39.                     {
  40.                         clearInterval(this._animation);
  41.                         this._animation = null;
  42.                     }
  43.                     
  44.                     this.precValue = aValue;
  45.                     
  46.                     if (this._officialValue != aValue)
  47.                     {
  48.                         this._officialValue = aValue;
  49.                         
  50.                         // fire DOM event so that accessible value change events occur
  51.                         var event = document.createEvent("Events");
  52.                         event.initEvent("ValueChange", true, true);
  53.                         this.dispatchEvent(event);
  54.                     }
  55.                 ]]></body>
  56.             </method>
  57.  
  58.             <property name="value" onget="return this.getAttribute('value') || '0';">
  59.                 <setter><![CDATA[
  60.                     var maxVal = Math.round(this.max || 100); // this.max isn't defined under Gecko 1.9.0
  61.                     var newVal = Math.min(Math.max(Math.round(val), 0), maxVal);
  62.                     var curVal = this.value;
  63.                     
  64.                     if (newVal <= curVal || curVal == 0 && newVal == maxVal)
  65.                     {
  66.                         this.endAnimation(newVal);
  67.                     }
  68.                     else
  69.                     {
  70.                         if (this._animation)
  71.                         {
  72.                             clearInterval(this._animation);
  73.                         }
  74.                         
  75.                         var step = Math.max(Math.round((newVal - curVal) / 10), 1);
  76.                         this._animation = setInterval(function(aThis) {
  77.                             if (aThis.precValue + step < newVal)
  78.                             {
  79.                                 aThis.precValue += step;
  80.                             }
  81.                             else
  82.                             {
  83.                                 aThis.endAnimation(newVal);
  84.                             }
  85.                         }, 15, this);
  86.                     }
  87.                     
  88.                     return val;
  89.                 ]]></setter>
  90.             </property>
  91.         </implementation>
  92.     </binding>
  93. </bindings>
  94.